/*
*  Copyright 2019-2025 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.log.dao;

import com.baomidou.mybatisplus.annotation.IdType;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import java.sql.Timestamp;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.ToString;
import lombok.experimental.Accessors;


@Data
@Accessors(chain = true)
@TableName("iws_log")
@ToString
public class LogDao implements Serializable {
    @TableId(value = "log_id", type = IdType.AUTO)
    @ApiModelProperty(value = "日志id")
    private Long logId;

    @ApiModelProperty(value = "日志子日志")
    private Long logChildId;

    @ApiModelProperty(value = "是否成功(1成功/0失败)")
    private Integer isReload;

    @ApiModelProperty(value = "描述")
    private String description;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "日志类型")
    private String logType;

    @ApiModelProperty(value = "是否成功")
    private String isSuccess;

    @ApiModelProperty(value = "请求方法")
    private String method;

    @ApiModelProperty(value = "请求链路")
    private String traceId;

    @ApiModelProperty(value = "顺序计数")
    private Integer sequence;

    @ApiModelProperty(value = "调用层数")
    private Integer callLevel;

    @ApiModelProperty(value = "请求参数")
    private String requestParams;

    @ApiModelProperty(value = "请求参数(全部)")
    private String requestParamsAll;

    @ApiModelProperty(value = "响应参数")
    private String responseParams;

    @ApiModelProperty(value = "请求IP")
    private String requestIp;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "用户地址")
    private String address;

    @ApiModelProperty(value = "网址")
    private String browser;

    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @ApiModelProperty(value = "请求类名")
    private String clazz;

    @ApiModelProperty(value = "请求方法")
    private String httpMethod;

    @ApiModelProperty(value = "请求时间")
    private Timestamp requestTime;

    @ApiModelProperty(value = "响应详情")
    private String stackTrace;

    @ApiModelProperty(value = "执行时间")
    private Long execTime;

    public void copy(LogDao source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
